package com.lancoo.znbkxx.teacher.aibkTestCoach.networkRequest.viewModel

import androidx.lifecycle.ViewModel
import com.lancoo.znbkxx.teacher.aibkTestCoach.networkRequest.async
import com.lancoo.znbkxx.teacher.aibkTestCoach.networkRequest.repo.EvalRepo
import okhttp3.RequestBody

/**
 * Created by Dadong on 2020/6/23
 * Describe:
 */
class EvalViewModel constructor(private var repo: EvalRepo) : ViewModel() {
    /*
      * 获取试卷的待评阅试题列表信息
      * */
    fun getPaperForEval(
            paperId: String,
            setId: String
    ) = repo.getPaperForEval(paperId, setId)
            .async()
            .doOnSuccess { }

    /*
     * (一对一)获取试卷的待评阅试题列表信息
     * */
    fun getPaperForEval_1v1(
            stuId: String,
            paperId: String
    ) = repo.getPaperForEval_1v1(stuId, paperId)
            .async()
            .doOnSuccess { }

    /*
   * 获取试卷的待评阅试题列表信息
   * */
    fun getQuesForEval(
            setId: String,
            paperId: String,
            quesID: String,
            startIndex: String
    ) = repo.getQuesForEval(setId, paperId, quesID, startIndex).async().doOnSuccess { }

    /*
  * (一对一)获取试卷的待评阅试题列表信息
  * */
    fun getQuesForEval_1v1(
            stuId: String,
            paperId: String,
            quesID: String,
            startIndex: String
    ) = repo.getQuesForEval_1v1(stuId, paperId, quesID, startIndex).async().doOnSuccess { }


    /*
   * 保存评阅
   * */
    fun savePaperEval(
            evalBody: RequestBody) = repo.savePaperEval(evalBody).async().doOnSuccess { }
}